//
//  PublicAdvertViewController.m
//  FastDoctor
//
//  Created by 李通 on 16/7/8.
//  Copyright © 2016年 sc. All rights reserved.
//

#import "PublicAdvertViewController.h"

@interface PublicAdvertViewController ()<UIWebViewDelegate>

@property (nonatomic,strong) UIWebView *publicWebView;


@end

@implementation PublicAdvertViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self setupUI];
    
    self.view.backgroundColor = WHITE_COLOR;
}

- (void)setupUI {
    
    NSString *urlString = @"http://202.106.210.115:18080/hyde-pluto-h360/nt/appEntrance.htm";
    
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy:0 timeoutInterval:15];
    
    [self.publicWebView loadRequest:request];
}

- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error {
    
    [SVProgressHUD showErrorWithStatus:@"网络异常"];
}

#pragma mark - 懒加载
- (UIWebView *)publicWebView {
    
    if (!_publicWebView) {
        
        _publicWebView = [[UIWebView alloc]initWithFrame:self.view.bounds];
        

        
        [self.view addSubview:_publicWebView];
    }
    return _publicWebView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
